<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var t = new Date();
      //获取时间戳 的4种方式
      //   1.获取原始值
      console.log(t.getTime());
      console.log(t.valueOf());
      console.log(+t);
      console.log(Date.now());
    </script>
  </body>
</html>
